import request from '../utils/request';
import qs from 'qs';

export async function fetchCartList(userId) {
	return request(`/ecs/cart/list.action?userId=${userId}`, {
		headers: {
			'Content-Type': 'application/x-www-form-urlencoded'
		}
	})
}

export async function deleteCart(cartId) {
	return request(`/ecs/cart/remove.action`, {
		method: 'POST',
		headers: {
			'Content-Type': 'application/json'
		},
		body: JSON.stringify({
			cartId
		})
	})
}

export async function modifyCartNumber(payload) {
	return request(`/ecs/cart/modify.action`, {
		method: 'POST',
		headers: {
			'Content-Type': 'application/json'
		},
		body: JSON.stringify(payload)
	})
}